#ifndef _LING_UTILS_H
#define _LING_UTILS_H

//利用float的存储疼来计算log2的值
static inline int FastLog2(int x)
{
    float fx;
    unsigned long ix, exp;

    fx = (float)x;
    ix = *(unsigned long*)&fx;
    exp = (ix >> 23) & 0xFF;

    return exp - 127;
}

#endif
